package utils

import (
	"os"
	"path/filepath"
)

func FindLuaFiles(root string) ([]string, error) {
	var luaFiles []string

	err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if !info.IsDir() && filepath.Ext(path) == ".lua" {
			luaFiles = append(luaFiles, path)
		}
		return nil
	})

	return luaFiles, err
}
